<?php

/**
 * @author Andy
 * @copyright 2013
 */

require_once dirname(__FILE__) . '/includes/main.inc.php';

$templatedir = 'templates/';

$list = array_diff(scandir($templatedir), array('.', '..'));

foreach ($list as $file) {
    $extension = pathinfo($file, PATHINFO_EXTENSION);
	rename($templatedir.$file, $templatedir.str_replace($extension, 'tpl', $file));
}

print "<pre>";
print_r($list);
?>